package com.smart.manager.member.entities.models;

import com.smart.common.entities.core.BaseLongModel;
import com.smart.manager.member.entities.enums.CoinAccountEvent;
import com.smart.manager.member.entities.views.MemberView;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import java.time.LocalDateTime;


/**
 * 会员-金币账单
 *
 * @author Administrator
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Accessors(chain = true)
public class MemberCoinBill extends BaseLongModel {

    /**
     * 会员资料
     */
    @ApiModelProperty( value = "会员编号")
    @ManyToOne
    @JoinColumn(name = "member", referencedColumnName = "id")
    private MemberView member;

    /**
     * 发生时间
     */
    @ApiModelProperty("发生时间")
    private LocalDateTime eventTime;

    /**
     * 交易事件
     */
    @ApiModelProperty("交易事件")
    private CoinAccountEvent event;

    /**
     * 期初金币数
     */
    @ApiModelProperty("期初数")
    private Integer originalTotal;

    /**
     * 事件金币生数
     */
    @ApiModelProperty("事件金币生数")
    private Integer eventTotal;


    /**
     * 事后期末数
     */
    @ApiModelProperty("期末数")
    private Integer remainTotal;


    /**
     * 备注信息
     */
    @ApiModelProperty("备注信息")
    private String remark;


}
